package org.kevin.dao;

import org.apache.ibatis.annotations.*;
import org.kevin.bean.Employee;
import org.springframework.stereotype.Component;

/**
 * @ClassName: EmployeeMapper
 * @Description: TODO
 * @Author: kevin
 * @Date: 2019/8/23 16:26
 * @Version: 1.0
 */
@Mapper
@Component
public interface EmployeeMapper {

    @Select("select * from employee where id = #{id}")
    public Employee getEmployeeById(Integer id);

    @Insert("insert into employee(lastName,email,gender,d_id) values(#{lastName},#{email},#{gender},#{dId}")
    public void insertEmp(Employee employee);

    @Update("update employee set lastName=#{lastName},email=#{email},gender=#{gender},d_id=#{dId} where id = #{id}")
    public void updateEmp(Employee employee);

    @Delete("delete from employee where id=#{id}")
    public void deleteEmpById(Integer id);

    @Select("select * from employee where lastName=#{lastName}")
    public Employee getEmpByLastName(String lastName);
}
